Posted by Chris Lundie from dialin80.eagle.ca (206.186.242.175)on March 08, 1998 at 19:21:44:
In Reply to: Glide wrapper changes posted by Jeff C on March 08, 1998 at 06:19:05:
Great stuff! It's quite obvious you are more experienced with C than I am. Just seeing the changes you made has taught me a few things.
Someone mentioned that VC++ is probably a lot faster than LCC. But in WarpedGlide I don't see any speed difference. I'm almost certain now that the Verite itself is the bottleneck. I hope that remains true even with full blown games. Look how simple some of the functions are. I bet that a lot of "native" RRedline games are doing almost as much stuff as the wrapper is doing. Because they might just convert the game from Glide anyway.
Now a few comments to help out:
Environment Variables
On a Voodoo there are lots of environment variables you can use to tweak the card. We could make use of some of them in Big RRed.
Antialiasing
I don't think antialiasing is working right. In RRedline there has to be a very specific drawing state set before you can do antialiasing. I tried the Glide antialiased lines test and the lines got fatter, but I don't think they were smoothed out.
Swap Interval
If you set it to zero there might be problems. The Verite could swap buffers before the command buffer is done. If you set gl_swapinterval 0 in Quake 2, you will see really bad looking flashing artifacts, not just "tearing". I think that might happen here... Not sure. Maybe the user could have the choice to force the swap interval to 1.
Interleaved buffers
The reason I wanted that out for now, is because it needs some more code to support it properly. You can't just make the buffers interleaved and expect it to work without problems. The RRedline docs have this code somewhere. BTW It doesn't improve performance on a V2000 anyway.
Planar Polygons
You have the right idea just copying the code from regular polygons. According to the Glide docs, it's just a speed optimisation for Voodoos, but functionally identical. It's too bad most Glide games don't seem to use the polygon functions, they just use triangles. It would save tons of setup time if they could use triangle fans and strips. I think I've heard that Glide *will* have strips soon, which will reduce setup time in Quake 2 by about half. And of course it will be easy to emulate in Big RRed and have similar improvements in speed.
Z buffering
It kind of sucks that Glide has two kinds of depth buffer. The Z and W buffer. You are supposed to use the W buffer (which is floating point, and maps to 'Q' on Verite) because it's more precise, and that's the one that Big RRed tries to deal with right now. In the future it will have to know the difference. And it may have to play around with the numbers since Verite only has Z.
Antialiased Points
I think you are supposed to use VL_Particle or something like that. Although I'm not sure if it really does any antialiasing. It's pretty silly to antialias a point anyway. Basically it just makes a little blurry dot...
Antialiased Polygons
You have to draw the polygon, then set the drawing state for antialiasing, then draw the antialiased edges. Then set the drawing state back to what it was before... If there is a Z buffer you could ignore this because a real Voodoo can't do depth buffering and antialiasing at the same time. (Who knows why?)
grGlideGetVersion
you seem a bit confused. Here is the code:
/* jeffc 030798 */
/* hmmmm... */
FX_ENTRY void FX_CALL grGlideGetVersion( char version[80] ){
int i;
for (i = 0; i<80; i++) {
version[i] = ver[i];
}
}
All I am trying to do is set version[80] to be a string of 80 characters. This is the only way I got it to work... by copying character by character. Maybe it's my compiler, maybe I just don't know how to do it right yet. By the way, when you configure your graphics in Wing Commander Prophecy, it will actually use this string as a description. It's cool to actually choose "Big RRed" in a menu, instead of "Glide" :)
Clipping
Like all the "gu" functions, I think it's a waste of space that 3Dfx never should have put in Glide. The "gu" functions are all utilities for lazy programmers. But yes I have seen lots of games that use some of them. Surprisingly enough, the 3Dfx MiniGL that comes with the Hexen II demo uses very few functions. I would say it is one of the first games that may work. OpenGL->Glide->RRedline!
Whew that's a lot of comments from me. :) Keep it up, Jeff and anyone else who is coding.